<?php
require_once('feed.php');
class shopzilla extends feed {
	var $CategoryId;
	public function __construct($site,$products){
		parent::__construct($site,$products);
		$this->mapping=array('Category ID','Manufacturer','Title','Description','Product URL','Image URL','SKU','Availability','Condition','Ship Weight','Ship Cost','Bid','Promotional Code','UPC','Price');
		$this->CategoryId='11,580,100';
	}
	
		
	public function toExcel(){
		$count=sizeof($this->data);
		$this->excel.="<table width='100%' border='0'>";
		$this->excel.="<tr>";
		if(is_array($this->mapping)){
			foreach($this->mapping as $key=>$value){
				$this->excel.="<td>".$value."</td>";
			}					
		}
		$this->excel.="</tr>";
		foreach($this->data as $info){
			$this->excel.="<tr><td>";
			$this->excel.=$this->CategoryId."</td><td>";
			$this->excel.=$info['made_in']."</td><td>";
			$this->excel.=$info['name']."</td><td>";
			$this->excel.=$info['description']."</td><td>";
			$this->excel.=$info['product_url'].".html</td><td>";
			$this->excel.=$info['image_url']."</td><td>";
			$this->excel.=$info['sku']."</td><td>";
			$this->excel.="new"."</td><td>";
			$this->excel.=" "."</td><td>";
			$this->excel.=$info['weight']."</td><td>";
			$this->excel.=" "."</td><td>";
			$this->excel.=" "."</td><td>";
			$this->excel.=" "."</td><td>";
			$this->excel.=" "."</td><td>";
			$this->excel.=$info['price']."</td>";			
			$this->excel.="</tr>";			
			}
		$this->excel.="</table>";		
		$this->excel.="</body>";		
		$this->excel.="</html>";				
		return $this->excel;
		}
	
 function toTxt(){
	 $count=sizeof($this->data);
	 if(is_array($this->mapping)){
			$this->txt.=$this->mapping[0];
			for($i=1;$i<sizeof($this->mapping);$i++){
			$this->txt.="\t".$this->mapping[$i];
			}
		$this->txt.=chr(13);	
		}
	foreach($this->data as $info){
			$this->txt.='11,580,100'."\t";
			$this->txt.='China'."\t";
			$this->txt.=$info['name']."\t";
			$this->txt.=$info['description']."\t";
			$this->txt.=$info['product_url'].".html"."\t";
			$this->txt.=$info['image_url']."\t";
			$this->txt.=$info['sku']."\t";
			$this->txt.=" "."\t";
			$this->txt.=" "."\t";
			$this->txt.=$info['weight']."\t";
			$this->txt.=" "."\t";
			$this->txt.=" "."\t";
			$this->txt.=" "."\t";
			$this->txt.=" "."\t";
			$this->txt.=$info['price'];
			$this->txt.=chr(13);
		}
		return $this->txt;
	
}
}
?>